package com.woniu.service.command;

import com.woniu.outlet.mysql.po.FundRela;
import com.woniu.outlet.redis.po.FundRedis;
import com.woniu.util.ApplicationContextHolder;
import lombok.Data;

import java.util.List;

/**
 * @description:
 * @author: my
 * @time: 2021/5/11 19:52
 */
@Data
public class FundShowCommand {
    private FundShowCommandHandler handler;
    private String status;
    private Integer pageIndex;
    private Integer pageNum;

    public FundShowCommand(){
        this.handler =
                ApplicationContextHolder.getApplicationContext().getBean(FundShowCommandHandler.class);
    }

    public FundShowCommand(String status,Integer pageIndex,Integer pageNum){
        this();
        this.status = status;
        this.pageIndex = pageIndex;
        this.pageNum = pageNum;
    }

    public List<FundRela> execute(){
        return this.handler.action(this);
    }
}
